/** navbar
 *
 * @file sitemap.js
 * @author fe
 */
function genNavigator() {
    var navItems = '<li><a href="BarChart.html">BarChart</a></li>'
        + '<li><a href="CandidateArea.html">CandidateArea</a></li>'
        + '<li><a href="CheckboxGroup.html">CheckboxGroup</a></li>'
        + '<li><a href="CopyButton.html">CopyButton</a></li>'
        + '<li><a href="CustomField.html">CustomField</a></li>'
        + '<li><a href="Drawer.html">Drawer</a></li>'
        + '<li><a href="ImagePanel.html">ImagePanel</a></li>'
        + '<li><a href="ImageList.html">ImageList</a></li>'
        + '<li><a href="InputGroup.html">InputGroup</a></li>'
        + '<li><a href="LineChart.html">LineChart</a></li>'
        + '<li><a href="MultiSelect.html">MultiSelect</a></li>'
        + '<li><a href="Radio.html">Radio</a></li>'
        + '<li><a href="RegionChart.html">Region Chart</a></li>'
        + '<li><a href="SearchTree.html">SearchTree</a></li>'
        + '<li><a href="TableRichSelectorPro.html">TableRichSelectorPro</a></li>'
        + '<li><a href="TagZone.html">TagZone</a></li>'
        + '<li><a href="Uploader.html">Uploader</a></li>'
        + '<li><a href="UploaderContainer.html">UploaderContainer</a></li>';

    var navigator = document.getElementById('navigator');
    navigator.innerHTML = navItems;
    var url = window.location.pathname;
    var filename = url.substring(url.lastIndexOf('/') + 1);
    var links = navigator.getElementsByTagName('a');
    for (var i = 0; i < links.length; i++) {
        if (links[i].getAttribute('href') === filename) {
            var parent = links[i].parentNode;
            parent.setAttribute('class', 'ui-nav-item-active');
        }
    }
}
genNavigator();

function footer() {
    var footHtml = '<p class="ui-text-center contrast">HI群：1401953</p>';
    var footerNode = document.createElement('div');
    footerNode.setAttribute('class', 'footer');
    footerNode.innerHTML = footHtml;
    document.getElementsByTagName('body')[0].appendChild(footerNode);
}
footer();
